[HVM] Save/restore: qemu-dm should calculate bitmap size from maximum gpfn
authorTim Deegan <Tim.Deegan@xensource.com>
Thu, 5 Apr 2007 17:12:21 +0000 (18:12 +0100)
committerTim Deegan <Tim.Deegan@xensource.com>
Thu, 5 Apr 2007 17:12:21 +0000 (18:12 +0100)
like xc_save does.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
tools/ioemu/xenstore.c

index e04a74236cf1ce75ce1d190d6bfd68d2b720af60..35484bbc90f058672902f7bb9e5f1636075387bb 100644 (file)
@@ -248,12 +248,8 @@ void xenstore_process_logdirty_event(void)
         key = (key_t) strtoull(key_terminated, NULL, 16);
 
         /* Figure out how bit the log-dirty bitmaps are */
-        logdirty_bitmap_size = ((phys_ram_size + 0x20 
-                                 - (vga_ram_size + bios_size)) 
-                                >> (TARGET_PAGE_BITS)); /* nr of bits in map*/
-        if (logdirty_bitmap_size > HVM_BELOW_4G_MMIO_START >> TARGET_PAGE_BITS)
-            logdirty_bitmap_size += 
-                HVM_BELOW_4G_MMIO_LENGTH >> TARGET_PAGE_BITS; /* still bits */
+        logdirty_bitmap_size = xc_memory_op(xc_handle, 
+                                            XENMEM_maximum_gpfn, &domid) + 1;
         logdirty_bitmap_size = ((logdirty_bitmap_size + HOST_LONG_BITS - 1)
                                 / HOST_LONG_BITS); /* longs */
         logdirty_bitmap_size *= sizeof (unsigned long); /* bytes */